import React from 'react';
import style from './style.styl';

class ReviewHeader extends React.Component {
  constructor(props) {
    super(props);
    this.displayName = 'ReviewHeader';
  }
  goBack = () => {
    this.props.goBack && this.props.goBack();
  }
  render() {
    const {
      title
    } = this.props;
    return (
      <div className={style['header-layout']}>
        <div className={style['header-container']}>
          <div className={style['header-box']}>
            <div className={style['header-title']}>
            {this.props.goBack ? 
              <div className={style['header-back']} onClick={this.goBack}></div>
              : null
            }
            {title}</div>
            <div className={style['header-btns']}>
              {this.props.rightBtn}
            </div>
          </div>
        </div>
      </div>
    );
  }
}

export default ReviewHeader;
